<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.fc.util.*" %>
<%@ page import="com.fc.model.Member" %>
<%@ page import="com.fc.control.MemberControl" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>member_add_do</title>
</head>
<body>
<%
      request.setCharacterEncoding("UTF-8");
      String start_time = ParamUtil.getString(request,"start_time");   
      String end_time = ParamUtil.getString(request,"end_time");
      String idcard = ParamUtil.getString(request,"idcard");
      String name = ParamUtil.getString(request,"name");
      String phone = ParamUtil.getString(request,"phone");
      String username = ParamUtil.getString(request,"username");
      String password = ParamUtil.getString(request,"password");
  	  int store_id =  ParamUtil.getInt(request,"store_id");
  	  int kind =  ParamUtil.getInt(request,"kind");
  	  int sex =  ParamUtil.getInt(request,"sex");
  	  
  	  //CoachControl cc = new  CoachControl();
      Member member = new Member();
      
      member.setStart_time(start_time);
	  member.setEnd_time(end_time);
	  member.setIdcard(idcard);
	  member.setName(name);
	  member.setPhone(phone);
	  member.setUsername(username);
	  member.setPassword(password);
	  member.setStore_id(store_id);
	  member.setKind(kind);
	  member.setSex(sex);
        if(MemberControl.addMember(member))
  			{
  				%>
		<script language="javascript">
				if(window.confirm("添加成功，是否继续?"))
				window.location.href="member.jsp";
				else
  				window.location.href="member.jsp";
  				</script>
		<%} else { %>
		<script language="javascript">
  				if(window.confirm("添加失败，是否重新添加?"))
				window.location.href="member_add.jsp";
				else
				window.location.href="member.jsp";
  		</script>
		<%} 
   %>
</body>
</html>